-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix golint #33 #34
Fix golint #33 #34
Conversation
iterator.go
Outdated
@@ -4,6 +4,7 @@ | |||
|
|||
package rbtree | |||
|
|||
// Iterator is the function of iteration entity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we may add a sample to help people to understand the Iterator
type, how about
// Iterator is the function of iteration entity which would be
// used by those functions like `Ascend`, `Dscend`, etc.
//
// A typical Iterator with Print :
// func loop_with_print(item rbtree.Item) bool {
// i, ok := item.(XXX)
// if !ok {
// return false
// }
// fmt.Printf("%+v\n", i)
// return true
// }
rbtree.go
Outdated
RED = 0 | ||
// RED represents the color of the node is red | ||
RED = 0 | ||
// BLACK represents the color of the node is brack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo :) brack
rbtree.go
Outdated
BLACK = 1 | ||
) | ||
|
||
// Item has a method to compare its which is less |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo?
stats.go
Outdated
@@ -41,6 +43,7 @@ func (t *Rbtree) Delete(item Item) Item { | |||
return t.delete(&Node{t.NIL, t.NIL, t.NIL, RED, item}).Item | |||
} | |||
|
|||
//Get search the node which includes its node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about something like
// Get search for the specified item (which was carried by a Node) in the tree, return nil if not found.
Could you please add your sign-off , the rest LGTM.
|
Fixes #33
I fixed all golint warnings. Almost I fixed the comment of expose items.
it might be misunderstanding those exposed func, var...